package com.moon.icoresso.Service;

import com.moon.icoresso.pojo.bo.OauthAccessTokenToRedisBO;
import com.moon.icoresso.pojo.bo.OauthToRedisBO;
import com.moon.icoresso.pojo.dto.OauthTokenDTO;
import com.moon.icoresso.pojo.dto.OauthTokenParam;
import com.moon.icoresso.pojo.dto.OauthTokenVerifyParam;
import com.moon.icoresso.pojo.dto.UserDTO;

import javax.servlet.http.HttpServletRequest;

public interface OauthService {
    /**
     * 判断clientId是否符合要求
     * @param clientId
     * @return
     */
    OauthToRedisBO checkClientIdAndRedirectUri(UserDTO userDTO);

    void checkUserAgent(String userAgent);

    void checkUserDTO(UserDTO userDTO);

    /**
     * 生成授权码
     * @return
     */
    String generateCode();

    /**
     * 生成token
     * @param isGenerateRefreshToken
     * @return
     */
    OauthTokenDTO generateToken(boolean isGenerateRefreshToken);


    void checkGrantType(String grantType);


    OauthAccessTokenToRedisBO checkRequestParam(HttpServletRequest request);

    void checkOauthTokenVerifyParam(OauthTokenVerifyParam oauthTokenDTO);

    void checkClientAndClientSecret(String clientId,String clientSecret);

    void checkRefreshToken(OauthTokenParam oauthTokenParam);
}
